Previous Book Contents Book Index Next

Inside Macintosh: QuickTime /
Chapter 2 - Movie Toolbox / Movie Toolbox Reference
Functions for Getting and Playing Movies / Movies and Your Event Loop


MoviesTask

The MoviesTask function services active movies.

pascal void MoviesTask (Movie theMovie, long maxMilliSecToUse);
theMovie
Specifies the movie for this operation. If you set this parameter to nil, the Movie Toolbox services all of your active movies. Your application obtains this movie identifier from such functions as NewMovie, NewMovieFromFile, and NewMovieFromHandle (described on page 2-80, page 2-76, and page 2-78, respectively).
maxMilliSecToUse
Determines the maximum number of milliseconds that MoviesTask can work before returning. If this parameter is 0, MoviesTask services every active movie exactly once and then returns. If the parameter is nonzero, MoviesTask services as many movies as it can in the allotted time before returning.
Once the MoviesTask function starts servicing a movie, it cannot stop until it has completely met the requirements of the movie. Consequently, the MoviesTask function may execute for a longer time than that specified in maxMilliSecToUse. However, the function does not start servicing a new movie if the time specified by maxMilliSecToUse has elapsed.
The preferred way to use MoviesTask is to set the maxMilliSecToUse parameter to 0; however, if you just want to play one movie, you can call MoviesTask on that one.
If your rate is 0, MoviesTask draws that frame and no other.
DESCRIPTION
When servicing a movie, the Movie Toolbox performs the processing that is appropriate for the movie--displaying frames, playing sound, reading data from disk, or other tasks. The only time the Movie Toolbox actually draws a movie is during the operation of the MoviesTask function.

You should call MoviesTask as often as possible from your application's main event loop. Note that you should call this function after you have performed your own event processing.

The MoviesTask function services only active movies, and only enabled tracks within those active movies. Use the SetMovieActive function (described on page 2-131) and the SetTrackEnabled function (described on page 2-132) to enable and disable movies and tracks.

SPECIAL CONSIDERATIONS
Note that the MoviesTask function services only your movies. Your application must call the Event Manager's WaitNextEvent routine (or the Event Manager's GetNextEvent routine and the SystemTask routine) to give other applications the opportunity to call MoviesTask for their movies. For details on WaitNextEvent, GetNextEvent, and SystemTask, see Inside Macintosh: Macintosh Toolbox Essentials.

ERROR CODES
invalidMovie-2010This movie is corrupted or invalid

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996